/*
** clear_screen.c for clear_screen in /home/comet_a//afs/local/sys_unix/my_select/ex_3
** 
** Made by alexandre comet
** Login   <comet_a@epitech.net>
** 
** Started on  Fri Jan 13 15:47:12 2012 alexandre comet
** Last update Tue Jan 31 15:32:08 2012 alexandre comet
*/

#include	<unistd.h>
#include	<curses.h>
#include	<term.h>

int		my_putchar(int c)
{
  write(1, &c, 1);
  return (0);
}

void		my_putstr(char *str)
{
  int		i;

  i = 0;
  while (str[i])
    my_putchar(str[i++]);
}

int		main()
{
  if (tgetent(0, "xterm") != 1)
    {
      my_putstr("No such entry or terminfo database coud not be found\n");
      return (0);
    }
  tputs(tgetstr("cl", 0), 1, my_putchar);
  return (0);
}
